package fileContent;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

//Scanner 实例化对象的时候system.in的in用的也是InputStream
public class Demo16 {
    public static void main(String[] args) {
        try(InputStream inputStream=new FileInputStream("./test.txt")){
            Scanner scanner=new Scanner(inputStream);
            while(scanner.hasNextLine()){
                System. out.println(scanner.nextLine());
            }
        }catch(IOException e){
            e.printStackTrace();
        }
    }
}
